home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Visual Basic new SourceCode and Projects / Webpage Maker 2000 / Folders.frm (.txt) next >
Encoding:
Visual Basic Form  |  2000-01-16  |  5.0 KB  |  154 lines

  1. VERSION 5.00
  2. Begin VB.Form Folders 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "  Folders"
  5.    ClientHeight    =   3255
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   3855
  9.    Icon            =   "Folders.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3255
  14.    ScaleWidth      =   3855
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.CommandButton cmdRemoveDir 
  17.       Caption         =   "Delete folder"
  18.       Height          =   375
  19.       Left            =   2160
  20.       MouseIcon       =   "Folders.frx":0442
  21.       MousePointer    =   99  'Custom
  22.       TabIndex        =   5
  23.       Top             =   1800
  24.       Width           =   1575
  25.    End
  26.    Begin VB.CommandButton cmdMkdir 
  27.       Caption         =   "Create Folder"
  28.       Height          =   375
  29.       Left            =   2160
  30.       MouseIcon       =   "Folders.frx":0594
  31.       MousePointer    =   99  'Custom
  32.       TabIndex        =   4
  33.       Top             =   2280
  34.       Width           =   1575
  35.    End
  36.    Begin VB.FileListBox File1 
  37.       Height          =   1065
  38.       Left            =   2160
  39.       Pattern         =   "*.htm*"
  40.       TabIndex        =   3
  41.       Top             =   120
  42.       Width           =   1575
  43.    End
  44.    Begin VB.CommandButton cmdExit 
  45.       Caption         =   "Exit"
  46.       Height          =   375
  47.       Left            =   2160
  48.       MouseIcon       =   "Folders.frx":06E6
  49.       MousePointer    =   99  'Custom
  50.       TabIndex        =   2
  51.       Top             =   2760
  52.       Width           =   1575
  53.    End
  54.    Begin VB.CommandButton cmdSave 
  55.       Caption         =   "Save Path"
  56.       Height          =   375
  57.       Left            =   2160
  58.       MouseIcon       =   "Folders.frx":0838
  59.       MousePointer    =   99  'Custom
  60.       TabIndex        =   1
  61.       Top             =   1320
  62.       Width           =   1575
  63.    End
  64.    Begin VB.DirListBox Dir1 
  65.       Height          =   3015
  66.       Left            =   120
  67.       TabIndex        =   0
  68.       Top             =   120
  69.       Width           =   1935
  70.    End
  71. Attribute VB_Name = "Folders"
  72. Attribute VB_GlobalNameSpace = False
  73. Attribute VB_Creatable = False
  74. Attribute VB_PredeclaredId = True
  75. Attribute VB_Exposed = False
  76. '#################################################'
  77. '## ##  -----------------------------------  ## ##'
  78. '## ##  Program name: Webpage Maker 2000     ## ##'
  79. '## ##  Started in: October, 1999            ## ##'
  80. '## ##  Author: David VanHook                ## ##'
  81. '## ##  -----------------------------------  ## ##'
  82. '#################################################'
  83. '----------------------VARIABLE SECTION-----------------------'
  84. Dim x As Integer
  85. Dim filepath As String
  86. Dim File As String
  87. Dim secTitle As String
  88. Dim subSecTitle As String
  89. Dim pathName As String
  90. '--------------------FORM UNLOAD SECTION----------------------'
  91. Private Sub cmdExit_Click()
  92.   Unload Me
  93. End Sub
  94. '---------------------MAKE NEW DIRECTORY----------------------'
  95. Private Sub cmdMkdir_Click()
  96.   On Error Resume Next
  97.   If Right(Dir1.Path, 1) <> "\" Then
  98.     filepath = Dir1.Path & "\"
  99.   Else
  100.     filepath = Dir1.Path
  101.   End If
  102.   MkDir (filepath & InputBox("Enter name of folder.", "Make new directory"))
  103.   Dir1.Refresh
  104. End Sub
  105. '----------------------REMOVE DIRECTORY-----------------------'
  106. Private Sub cmdRemoveDir_Click()
  107.   On Error Resume Next
  108.   If Dir1.Path = "C:\" Or Dir1.Path = "C:\WINDOWS" Then
  109.     Call MsgBox("Important directory!  Can't be deleted.", vbExclamation, "Error")
  110.     Exit Sub
  111.   End If
  112.   If Right(Dir1.Path, 1) = "\" Then
  113.     filepath = Dir1.List(Dir1.ListIndex)
  114.   Else
  115.     filepath = Dir1.List(Dir1.ListIndex) & "\"
  116.   End If
  117.   Answer = MsgBox("Do you want to delete this file?", vbExclamation + vbYesNo, " Deletion confirmation")
  118.   If Answer = vbYes Then
  119.     Kill (filepath & "*.*")
  120.     RmDir (filepath)
  121.     Me.Refresh
  122.     Dir1.Refresh
  123.   End If
  124. End Sub
  125. '----------------SAVE FREQUENTLY USED FOLDER------------------'
  126. Private Sub cmdSave_Click()
  127.   CompanyX.Combo1.AddItem Dir1.Path
  128.   File = App.Path & "\wpm2000.ini" 'Path and file name of ini
  129.   secTitle = "Folders"  'Section name
  130.   For x = 0 To CompanyX.Combo1.ListCount - 1
  131.     subSecTitle = "Favorite Folders" & x 'Subsection
  132.     pathName = CompanyX.Combo1.List(x) 'Value to save
  133.     NewNumber = WritePrivateProfileString(secTitle, subSecTitle, pathName, File)
  134.   Next x
  135. End Sub
  136. '------------------SAVE FOLDER TO COMBOBOX--------------------'
  137. Private Sub Dir1_Change()
  138.   File1 = Dir1
  139.   For x = 0 To CompanyX.Combo1.ListCount
  140.         
  141.     If Dir1 = CompanyX.Combo1.List(x) Then
  142.       cmdSave.Enabled = False
  143.       Exit Sub
  144.     Else
  145.       cmdSave.Enabled = True
  146.     End If
  147.         
  148.   Next x
  149. End Sub
  150. '---------------------FORM LOAD SECTION-----------------------'
  151. Private Sub Form_Load()
  152.   Dir1.Path = "C:\"
  153. End Sub
  154.